package com.richper.springcloudh2020.controller;

import com.richper.springcloudh2020.entities.CommonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping(value = "/consumer")
@Slf4j
public class OrderController {

    @Autowired
    private RestTemplate restTemplate;

    private final String url = "http://cloud-provider-payment/payment/zk";

    @GetMapping(value = "/payment/zkGet")
    public String zk_get(){
        String str = url+"/zkGet";
        log.info(str);
        return restTemplate.getForObject(str, String.class);
    }
}